<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="../lib/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../src/jquery.timer-1.0.3.js"></script>
    <script type="text/javascript">
        $(function() {
            // the timer is fired immediately and then is fired every 1 second
            $.timer(0, function () {
                this.setDelay(1000);
                $('#example1').text(this.getCount());
            }).start();
            
            // the timer is fired 5 times
            $.timer(1000, function () {
                $('#example2').text(this.getCount());
            }).start(5);
            
            // the timer is fired only one time
            $.timer(1000, function() {
                $('#example3').text(this.getCount());
            }).once();
        });
    </script>
</head>
<body>
    <p>
        Fires the timer immediately and then every 1 second:<br />
        Count: <span id="example1">&nbsp;</span>
    </p>
    
    <p>
        The timer is fired 5 times:<br />
        Count: <span id="example2">&nbsp;</span>
    </p>
    
    <p>
        The timer is fired only one time:<br />
        Count: <span id="example3">&nbsp;</span>
    </p>
</body>
</html>
